home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12923 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.5 KB  |  52 lines

  1. Newsgroups: comp.lang.c++
  2. Path: in1.uu.net!world!mv!usenet
  3. From: ENGR@GSSI.MV.COM (Michael Furman)
  4. Subject: Re: Passing multidemensional arrays to functions?
  5. Message-ID: <Don82L.KCr@mv.mv.com>
  6. Mime-Version: 1.0
  7. Content-Type: Text/Plain; charset=US-ASCII
  8. Organization: GSSI
  9. Date: Fri, 22 Mar 1996 00:30:21 GMT
  10. References: <4islec$m41@matrix.mdn.com>
  11. X-Newsreader: WinVN 0.99.7
  12. X-Nntp-Posting-Host: gssi.mv.com
  13.  
  14. In article <4islec$m41@matrix.mdn.com>, jschell@aggie.mdn.com says...
  15. >
  16. >I am trying to pass a variable to a function but continue to get errors
  17. >no matter
  18. >what declaration I give the variable in the prototype statement.
  19. >
  20. >The variable:
  21. >        float variable[1][2]
  22. >
  23. >Can you make a sugestion as to what it should pass as?
  24.  
  25. What is "float variable[1][2]" ? If this is a declaration of array 1 * 2 of
  26. float numbers and you want to pass this wole array - it may be:
  27.  
  28.       void func(float formal_variable[1][2])
  29.         or
  30.       void func(float formal_variable[][2])
  31.  
  32. If variable[1][2] is just one element of some array and you want to pass it
  33. value:
  34.       void func(float value)
  35.  
  36.  
  37.  
  38.  
  39. >
  40. >Thanks
  41. >John
  42.  
  43. -- 
  44. <<< If you received it by E-mail: it is a copy of post to the newsgroup >>>
  45. ---------------------------------------------------------------
  46. Michael Furman,                       (603)893-1109
  47. Geophysical Survey Systems, Inc.  fax:(603)889-3984
  48. 13 Klein Drive - P.O. Box 97          engr@gssi.mv.com 
  49. North Salem, NH 03073-0097            71543.1334@compuserve.com
  50. ---------------------------------------------------------------
  51.  
  52.